#==============================================================================
# [RGSS/2] Element Imbuing States
# Version : 1.0
# Author : private/privateer
#==============================================================================
# States can now add elements to its user's actions.
#==============================================================================
# CHANGELOG :
# Ver. 1.0 | Initial Release
#==============================================================================
#==============================================================================
# CONFIGURATION STARTS! EDIT ONLY MARKED LINES!
#==============================================================================
module PSS_ElementImbuingStates
  IMBUING_STATES = {
  # STATE_ID => [IMBUED_ELEMENTS]
  18 => [9,10], # STATE ID 18 WILL IMBUES ELEMENT 9 & 10
  19 => [11,12]
  } 
end
#==============================================================================
# CONFIGURATION ENDS! DON'T EDIT FURTHER UNLESS YOU KNOW WHAT YOU'RE DOING!
#==============================================================================
class Game_Actor < Game_Battler
  include PSS_ElementImbuingStates
  # Aliasing my method
  alias pss_eis_element_set element_set
  def element_set
    imb_el = pss_eis_element_set
	# For each state_id in IMBUING_STATES
    for i in IMBUING_STATES.keys
	# If actors have the state_id as their state
      if @states.include?(i)
	  # For each imbued_elements in IMBUING_STATES
        for j in IMBUING_STATES[i]
		# Adding the elements to the user
          imb_el.push(j)
          return imb_el
        end
		# If actors don't have the state_id
      else
	  # For each imbued_elements in IMBUING_STATES
        for j in IMBUING_STATES[i]
		# Removing the elements from the user
          imb_el.delete(j)
          return imb_el
        end
      end
    end
  end
end